/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controllers.validation;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author Anthares
 */
public class Validator {

    private Pattern pattern;
    private Matcher matcher;

    public Validator(String regex) {
        pattern = Pattern.compile(regex);
    }

    public boolean isValid(final String hex) {
        matcher = pattern.matcher(hex);
        return matcher.matches();
    }
}
